home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / extendSurfaceToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.5 KB  |  123 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  14 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      extendSurfaceToolScript
  27. //
  28. //  Description:
  29. //    create wrapper around the extendSurface command
  30. //
  31. //  Input Arguments:
  32. //        0 ==> do the command.
  33. //        1 ==> show the tool/action option box
  34. //        2 ==> return the command
  35. //        3 ==> show tool/action option box
  36. //        4 ==> enter the tool
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41.  
  42. global proc extendSurfaceToolSetup( int $forceFactorySettings,
  43.                                      string $goToTool )
  44. {
  45.     global int $gStartWithAutoComplete;
  46.     if( $forceFactorySettings || !`optionVar -ex extendSurfaceEuc` ) {
  47.         optionVar -iv extendSurfaceEuc 0;
  48.     }
  49.     if( $forceFactorySettings || !`optionVar -ex extendSurfaceLac` ) {
  50.         optionVar -iv extendSurfaceLac $gStartWithAutoComplete;
  51.     }
  52.     if( "" != $goToTool ) {
  53.         scriptCtx -e -euc `optionVar -q extendSurfaceEuc` $goToTool;
  54.         scriptCtx -e -lac `optionVar -q extendSurfaceLac` $goToTool;
  55.     }
  56. }
  57.  
  58. global proc extendSurfaceValues ( string $toolName ) 
  59. {
  60.     performExtendSurface 3 $toolName;
  61.     scriptCtxCommonValues( $toolName );
  62. }
  63.  
  64. global proc extendSurfaceProperties()
  65. {
  66.     scriptCtxCommonProperties;
  67. }
  68.  
  69. proc createExtendSurfaceContext( string $tool )
  70. {
  71.     if( ! `scriptCtx -exists $tool` ) {
  72.         extendSurfaceToolSetup( 0, "" );
  73.         scriptCtx -i1 "extend.xpm"
  74.           -title "Extend Surface Tool"
  75.           -bcn "extendSurface"
  76.  
  77.           -exitUponCompletion `optionVar -q extendSurfaceEuc`
  78.           -totalSelectionSets 1
  79.           -expandSelectionList true
  80.           -fcs ("extendSurfaceToolScript 0")
  81.  
  82.           -setNoSelectionPrompt ("Select a NURBS surfaces or surface " +
  83.                                  "isoparms to extend.")
  84.           -setSelectionPrompt ("Select additional NURBS surfaces or surface " +
  85.                                "isoparms or " +
  86.                                "press ENTER to compute extend.")
  87.           -setDoneSelectionPrompt ("Press ENTER to compute extend.")
  88.  
  89.           -setAutoToggleSelection true
  90.           -setAutoComplete `optionVar -q extendSurfaceLac`
  91.           -setAllowExcessCount true
  92.           -showManipulators true
  93.  
  94.           -setSelectionCount 0
  95.           -nurbsSurface true
  96.           -isoparm true
  97.         $tool;
  98.     }
  99. }
  100.  
  101. global proc string extendSurfaceToolScript( int $setToTool )
  102. //
  103. //    Description :
  104. //        0 ==> do the command.
  105. //        1 ==> show the action option box
  106. //        2 ==> return the command
  107. //        3 ==> show tool/action option box
  108. //        4 ==> enter the tool/do the command
  109. {
  110.     string $tool = "";
  111.     if( $setToTool > 2 ) {
  112.         if( !`optionVar -q modelWithToolExtendSurface` ) {
  113.             $setToTool = 4 - $setToTool;
  114.         }
  115.         else {
  116.             $tool = "extendSurfaceContext";
  117.             createExtendSurfaceContext $tool;
  118.         }
  119.     }
  120.     return scriptToolScript( "performExtendSurface", $setToTool, $tool );
  121. }
  122.  
  123.